<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"> 

	<h:head>
		<title>Curso EAD Java EE 6 - JSF 2</title>
	</h:head>
	 
	<h:body>
		<h1>Cadastro de Funcionários</h1>
		<h:form>
			<h:messages />
			<h:panelGrid columns="2" border="1">
				<f:facet name="header">
					<h:outputText value="Funcionário" />
				</f:facet>
				<h:outputLabel value="Nome:" for="itNome" />
				<h:inputText id="itNome" value="#{funcionarioMB.funcionario.nome}"
							 required="true" requiredMessage="O campo nome é obrigatório" />
				<h:outputLabel value="Telefone:" for="itTelefone" />
				<h:inputText id="itTelefone" value="#{funcionarioMB.funcionario.telefone}" />
				<h:outputLabel value="Data de Admissão:" for="itDataAdm" />
				<h:inputText id="itDataAdm" value="#{funcionarioMB.funcionario.dataAdmissao}" />
				<h:outputLabel value="Salário: R$ " for="itSalario" />
				<h:inputText id="itSalario" value="#{funcionarioMB.funcionario.salario}" />

				<h:outputLabel value="Sexo:" for="cpSexo" />
				<h:selectOneRadio id="cpSexo" value="#{funcionarioMB.funcionario.sexo}">
					<f:selectItem itemValue="M" itemLabel="Masculino" />
					<f:selectItem itemValue="F" itemLabel="Feminino" />
				</h:selectOneRadio>

				<h:outputLabel value="Cargo:" id="cpCargo" />
				<h:selectOneMenu value="#{funcionarioMB.funcionario.cargo}">
					<f:selectItems value="#{funcionarioMB.cargoItens}" />
				</h:selectOneMenu>

				<f:facet name="footer">
					<h:commandButton value="Salvar" action="#{funcionarioMB.salvar}" />
					<h:commandButton value="Novo" action="#{funcionarioMB.novo}" />
				</f:facet>
			</h:panelGrid>
		</h:form><p/>
		<h:outputLink value="index.jsf">
			<h:outputText value="Voltar à tela inicial"/>
		</h:outputLink>
	</h:body>

</html>
